<template>
<view>
	<scroll-view scroll-y style="height:calc(100vh - 50px)">
		<swiper class="screen-swiper square-dot" indicator-dots circular autoplay interval="5000" duration="500">
			<swiper-item v-for="(item, index) in businessInfo.wheelPicList" :key="index">
				<image :src="item.picURL" mode="aspectFill"></image>
			</swiper-item>
		</swiper>

		<view class="bg-white">
			<view class="text-center text-bold p-xs padding mb-sm" @tap="thumbsUp">
				<text class="padding-left">{{businessInfo.businessName}}</text>
				<text class="fa fa-thumbs-o-up padding-left"></text>
				{{businessInfo.zanNum}}
			</view>
			<view class="flex">
				<view class="flex-sub text-center text-grey text-sm">
					浏览量 : {{businessInfo.businessHits}}
				</view>
				<view class="flex-sub text-center text-grey text-sm">
					距离 : {{distance !== 'null' ? distance : '--'}} km
				</view>
			</view>
			<view class="text-center text-sm p-xs padding mb-sm text-blue" @tap="map">
				<text class="fa fa-map-marker"></text>
				{{businessInfo.businessAddress}}
			</view>

			<view class="margin-xs notice bg-orange light padding-sm" v-if="businessInfo.bussAd">
				{{businessInfo.bussAd}}
			</view>

			<view class="card">
				<view class="card-header text-bold">简介</view>
				<view class="card-content">
					{{ businessInfo.profile ? businessInfo.profile : '暂无介绍' }}
				</view>
			</view>

			<block v-if="businessInfo.productShowList.length > 0">
				<view class="text-center text-bold p-xs padding mb-sm">产品展示</view>
				<view class="margin-bottom bg-white">
					<view v-for="(item, index) in businessInfo.productShowList" :key="index"
						style="text-align:center;width:46vw;margin:5px 2vw;float:left">
						<image style="width:46vw;height:100px" mode="aspectFill" @tap="proDetail" data-target="Image"
							:data-item="item" :src="item.picURL" />
						<view class="text-cut">{{item.picDesc}}</view>
					</view>
				</view>
			</block>

			<block v-if="businessInfo.miniQrCode">
				<view class="text-center margin padding" style="clear:both">
					<view class="padding text-green">
						点击小程序码进行识别，即可进入门店
					</view>
					<image :src="businessInfo.miniQrCode" style="height:35vw;width:35vw" @tap="preCode" />
					<view class="text-sm">
						<text class="text-red">{{businessInfo.businessName}}</text> 专属小程序码
					</view>
				</view>
			</block>
			<view class="margin padding">
				<button class="bg-yellow" @tap="enter">
					我是商家，我也要入驻
				</button>
				<view class="padding-top-sm text-sm padding-bottom">
					您的公司入驻在镖掌柜小程序后，会展示在平台中，附近的客户会优先看到你们的信息。我们会在公众号、官网、全国的行业群进行宣传。一次入驻。全国推广。
				</view>
			</view>
		</view>
	</scroll-view>

	<button @tap="showModal" class="fixed-add" style="background:#1aad19">
		<text class="pos-center">分享</text>
	</button>

<!-- 	<view class="cu-bar bg-white tabbar border shop fixed-bottom">
		<view class="action" @tap="home">
			<view class="cuIcon-home text-gray"></view>
			首页
		</view>
		<view class="action" @tap="focus">
			<view class="fa fa-heart"
				:class="{ 'text-red': businessInfo.star == 1, 'text-gray': businessInfo.star != 1 }"></view>
			收藏
		</view>
		<view class="action" @tap="map">
			<view class="fa fa-map-marker text-red"></view>
			导航
		</view>
		<view class="bg-red submit" @tap="phoneCall">一键拨号</view>
	</view> -->

	<view class="cu-modal" v-if="modalName === 'Image'">
		<view class="cu-dialog">
			<view class="bg-img" :style="{ backgroundImage: `url(${modalImg})` }" style="height:200px;">
				<view class="cu-bar justify-end text-white">
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close"></text>
					</view>
				</view>
			</view>
			<view class="cu-bar bg-white">
				<view class="action margin-0 flex-sub solid-left">{{modalTitle}}</view>
			</view>
			<view class="margin">{{modalContent}}</view>
		</view>
	</view>

	<view class="cu-modal bottom-modal" v-if="modalName === 'bottomModal'">
		<view class="cu-dialog">
			<view class="cu-bar bg-white">
				<view class="action text-green"></view>
				<view class="action text-gray" @tap="hideModal">取消</view>
			</view>
			<view class="padding-xl">
				<view class="flex">
					<view class="flex-sub padding-sm margin-xs radius">
						<button class="share-wx" open-type="share">
							<text class="fa fa-weixin pos-center" style="color:#fff;font-size:25px;"></text>
						</button>
						<view>分享到微信</view>
					</view>
					<view class="flex-sub padding-sm margin-xs radius">
						<view class="share-code" @tap="qrcode">
							<text class="fa fa-qrcode pos-center" style="color:#fff;font-size:25px;"></text>
						</view>
						<view>生成海报</view>
					</view>
				</view>
			</view>
		</view>
	</view>

	<view class="cu-bar bg-white tabbar border shop fixed-bottom">
		<view class="action" @tap="home">
			<view class="cuIcon-home text-gray"></view>
			首页
		</view>
		<view class="action" @tap="focus">
			<view class="fa fa-heart"
				:class="{ 'text-red': businessInfo.star == 1, 'text-gray': businessInfo.star != 1 }"></view>
			收藏
		</view>
		<view class="action" @tap="map">
			<view class="fa fa-map-marker text-red"></view>
			导航
		</view>
		<view class="bg-red submit" @tap="phoneCall">一键拨号</view>
	</view>
</view>	
</template>

<script>
	export default {
		data() {
			return {
				businessInfo: {
					wheelPicList: [],
					productShowList: []
				},
				qrcode: '',
				distance: '',
				businessID: '',
				scene: false, // 非二维码进入
				userID: '',
				modalName:''
			}
		},
		onLoad(options) {
			 
		},
		onShow() {

		},
		methods: {
			
		}
	}
</script>

<style>

</style>